<?php
/**
 * 用户配方管理模型
 * 
 * @author  Lee<a605333742@gmail.com>
 * @time    2016-07-31
 */
namespace Model;
use Think\Model;

class RecipeModel extends Model{       
    /*
     * 删除,禁用，审核，待审核用户配方
     * 
     * @return bool
     */
    public function edits($where){
        $g  =$where['id'];
        if(is_array($where['id'])){
            $g  =implode(',',$where['id']);
            $where['id']=array("in",implode(',',$where['id']));            
        }
        if($this->save($where)){
            $data=array(
                "user_id"   =>session("authId"),
                'content'   =>"编辑了id为 ".$g." 的核用户配方",
                "add_time"  =>time()
            );
            if(M("Log")->add($data)){
                return TRUE;
            }else{
                return FALSE;
            }
        }
    }
}
